{% extends 'base.html' %}
{% load static %}

{% block content %}
<h1>台站添加</h1>
{% include 'basic/include/station_form.html' %}
{% endblock content %}
{% block javascript %}
<script src="{% static 'js/jquery/jquery-4.3.1.min.js' %}"></script>
<script type="text/javascript">
    $("select[name='net'], input[name='code']").bind('input propertychange', function (event) {
        const net = $("select[name='net']").find("option:selected").text().toLowerCase();
        const code = $("input[name='code']").val().replace(/[\W]+/g, "-").toLowerCase();
        $("input[name='slug']").val(net + "-" + code);
    })
</script>
{% endblock javascript %}